# from tkinter.font import names
#
# string = "sfsffsf"
# print(type(string))
#
# a = 1
# print(type(a))
#
# f = 0.11111
# print(type(f))
#
# # name = "my name is "zhanghao""
# name = '我叫"张浩"'
# name1 = "我叫'张浩'"
# name3 = '''w "s"y"i"u'哥'''
#
# print(name)
# print(name1)
# print(name3)
#
# print(len(name))
# a1 = "hello"
# a2 = "world"
#
# print(a1+" "+a2)
#
# i = 10000000000000000000000000000000000000000000000000000000000000000000000
# print(i)
#
# """
# 这是一个注释字符串，用来进行解释说明
# """
#
# #格式化字符串的、
# a = 10
# print(f"a = {a}")
# print(f"a = {a + 100-10*2}")
#
# #控制台输入
# num = input('请你输入一个数：')
# print(f'你输入的是：{num}')
from idlelib.pyparse import trans
from operator import index

#数据的强制类型转化
# num = input('请你输入：')
# print(num)
# #数据类型转换
# num = int(num)
# print(num)
# num = float(num)
# print(num)
# num = str(num)
# print(num)

#求四个数的平均值
# a1 = input('请输入第一个值：')
# a2 = input('请输入第二个值：')
# a3 = input('请输入第三个值：')
# a4 = input('请输入第四个值：')
#
# a1 = float(a1)
# a2 = float(a2)
# a3 = float(a3)
# a4 = float(a4)
#
# print(f'平均值是为：{(a1+a2+a3+a4)/4}')

# print(8/9)
# a = 8
# b = 9
# a = a**2
# print(a)
# #地板流除法向下取整，正数和负数不一样
# print(6//4)
# print(-6//4)
#
# #关系运算符
# # print(7<8)
#
# a = "falkdjflkaj"
# b = "aaaaaa"
# print(a < b)
# print(a > b)
# print(a >= b)
# print(a <= b)
# print(a != b)
# print(a == b)

# a = 0.00000001
# b = 0.00000002
#
# print(a<b)
# print(b-a)
# print(0.1+0.3)

#逻辑运算符
# a = 9
# b = 19
# c = 10
# print(not a>b)
# print(a>b or b<c)
# print(a<b and b>a)
# print(a<b<c)

# #多元赋值
# a = 10
# b = 9
# a,b = b,a
# print(a,b)

#python不支持前置++和后置++
# a = 1
# ++a
# --a
# a +=a
# a **=a
# print(a)
#
# b = True
# print(a+b)
# b = 0;
# c:int = 0
# int s = 0;

# #判断是否为闰年
# i = input('请你输入一个数')
# i = int(i)
# if((i % 4 == 0 and i % 100 != 0)or(i % 400 == 0)):
#     print('是闰年')
# else:
#     print('不是闰年')

# #判断一个数是否为奇数
# i = int(input('请输入一个数：'))
# if i%2==0:
#     print('不是一个奇数')
# else:
#     print('是一个奇数')6

# #判断一个数是正数还是负数
# i = int(input('请输入一个数：'))
# if i < 0:
#     print('负数')
# elif i > 0:
#     print('正数')
# else:
#     print('0')

# #打印1-10
# i = 1
# while i<=10:
#     print(i)
#     i += 1

#计算 1-100 的和
# i = 1
# sum = 0
# while i <= 100:
#     sum += i
#     i += 1
# print(sum)

# #计算 5 的阶乘
# i = 1
# sum = 1
# while i <= 5:
#     sum *= i
#     i += 1
# print(sum)

# #求 1! + 2! + 3! + 4! + 5!
# i = 1
# sum = 0
# while i <= 5:
#     a = 1
#     b = 1
#     while a <= i:
#         b *= a
#         a += 1
#     sum += b
#     i += 1
# print(sum)

# #函数的定义
# def printf(begin,end):
#     i = 0
#     thesum = 0
#     for i in range(end+1,begin,-1):
#         thesum += i
#     print(thesum)
#
# printf(1,100)
#
# #返回值
# def add(x,y):
#     return x+y
#
# ret = add(100,1000)
# print(ret)
# print(add(110,1000))
# print(add(9.0,19))
# print(add("hello","world"))
#
# #函数返回多个值
# def printf1(a,b,c):
#     return a,b,c
#
# a,b,c = printf1(10,10,10)
# #使用_用来占位值只接受返回的部分值
# _,_,C = printf1(10,10,10)
# print(C)
# print(a,b,c)

#global关键字

# x = 10
# def test():
#     global x
#     x = 20

# x = 10
# def test():
#     print(f'x = {x}')
#
# print(x)

# x = 10
# def text():
#     global x
#     x = 20
#     print(x)
# text()
# print(x)

#函数的执行过程

# def test():
#     print("1111")
#     print("2222")
#     print("3333")
#
#
# print("            ")
# test()
# print("            ")
# test()
# print("            ")
# test()
# print("            ")

# def add(x,y,debug = False):
#     if debug:
#         print(f'x={x} y ={y}')
#     return x+y
#
# # ret = add(20,20,True)
# # ret = add(10,10)
# ret = add(x = 10,y = 20)
# print(ret)

# def printf(a = 10,b = 19):
#     print(a)
#     print(b)
#
# def printf1(a, b):
#     print(a)
#     print(b)
#
# printf(30,29)
#
# printf1('fadfad','fadfadf')

#列表和元组
# arr = []
# print(arr)

# arr[0]=1
# print(arr)
# arr = [10,101,'f','0','0',0,9,2,4,68,9,0]
# i = 0
# for i in arr:
#     arr[i] = i
#     i += 1
# print(arr)

# arr = list(1,3,5,6)
# print(arr)

# arr = [1,4,6,7,9,0,4,6,8,3,2]
# i = 0
# while i < len(arr):
#     print(arr[i])
#     i += 1

# arr = [1,4,6,7,9,0,4,6,8,3,2]
# # arr[100]
# print(arr[-1])
# print(arr[len(arr)-1])
#
# arr = [1,4,6,7,9,0,4,6,8,3,2]
# print(arr[1:3])
#
# alist = [1, 2, 3, 4]
# print(alist[1:]) # 省略后边界, 表示获取到列表末尾
# print(alist[:-1]) # 省略前边界, 表示从列表开头获取
# print(alist[:])
#
# alist = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# print(alist[::1])
# print(alist[::2])
# print(alist[::3])
# print(alist[::5])
#
#
# alist = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# print(alist[::-1])
# print(alist[::-2])
# print(alist[::-3])
# print(alist[::-5])
#
# alist = [1,2,3,4,5]
# for i in alist:
#     print(i)
#
# a = [1,"4",'0','4',5]
# for i in range(0,len(a)):
#     print(i)
# print(len(a))
#
# a.append(8)
# a.append(9)
# a.insert(1,3)
# a.insert(10,'hlll')
# print(a)

# #使用in判断元素是都在一个列表中
# a1 = [1,2,3,4,5,6,7]
# print(1 in a1)
# print(10 in a1)
# print(1 not in a1)
# print(10 not in a1)
# print(a1.index(3))
#
# #使用pop方法进行删除数据
# a1.pop()
# print(a1)
# #使用pop方式通过下标进行删除
# a1.pop(2)
# print(a1)
#
# #使用remove方法进行指定元素的删除
# a1.remove(3)
# print(a1)

#
# #列表的拼接
# a = [1,2,3,4,5]
# b = [6,7,8,9,10]
# a.extend(b)
# print(a)
# print(b)
#
# a = [1,2,3,4,5]
# b = [6,7,8,9,10]
# a = a + b
# print(a)
# print(b)
#
# a = [1,2,3,4,5]
# b = [6,7,8,9,10]
# a += b
# print(a)
# print(b)
#
# a = [1,2,3,4,5]
# b = [6,7,8,9,10]
# c = a+b
# print(a)
# print(b)
# print(c)
#
# 元表不可以被修改
# a = (1,2,3,5,5,6)
# # a.pop()
# # a.appand()
#

# #字典
# map = {
#     'id' : 1,
#     'name':"zhangsan"
# }
# print('id' in map)
# print('id' not in map)
#
# print(map['id'])
# map['id'] = 4
# print(map['id'])
# print(map)

a = {
    'id': 4,
    'name' : "zhanghao",
    'srcoe': 80
}
a ['sex'] ='女'
# print(a)
# # a.pop('sex')
# # print(a)
# for elem in a:
#     print(elem,a[elem])
print(a.keys())
print(a.values())
print(a.items())

for key,value in a.items():
    print(key,value)

